/*
 * Copyright 2015-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.dcp.jeedcp.modules.report.entity.report;

import com.dcp.jeedcp.common.persistence.DataEntity;
import com.dcp.jeedcp.common.utils.excel.annotation.ExcelField;
import org.hibernate.validator.constraints.Length;

/**
 * 报表设置Entity
 * @author henry
 * @version 2017-05-12
 */
public class Report extends DataEntity<Report> {
	
	private static final long serialVersionUID = 1L;
	private String uid;		// 报表唯一ID,由接口调用方传入
	private String categoryId;		// 报表分类id
	private String dsId;		// 数据源ID
	private String name;		// 报表名称
	private String sqlText;		// 报表SQL语句
	private String metaColumns;		// 报表列集合元数据(JSON格式)
	private String queryParams;		// 查询条件列属性集合(JSON格式)
	private String options;		// 报表配置选项(JSON格式)
	private String status;		// 报表状态（1表示锁定，0表示编辑)
	private String sequence;		// 报表节点在其父节点中的顺序
	private String comment;		// 说明备注
	private String createUser;		// 创建用户

	public Report() {
		super();
	}

	public Report(String id){
		super(id);
	}

	@Length(min=0, max=128, message="报表唯一ID,由接口调用方传入长度必须介于 0 和 128 之间")
	@ExcelField(title="报表唯一ID,由接口调用方传入", align=2, sort=1)
	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}
	
	@Length(min=1, max=11, message="报表分类id长度必须介于 1 和 11 之间")
	@ExcelField(title="报表分类id", align=2, sort=2)
	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}
	
	@Length(min=1, max=11, message="数据源ID长度必须介于 1 和 11 之间")
	@ExcelField(title="数据源ID", align=2, sort=3)
	public String getDsId() {
		return dsId;
	}

	public void setDsId(String dsId) {
		this.dsId = dsId;
	}
	
	@Length(min=1, max=50, message="报表名称长度必须介于 1 和 50 之间")
	@ExcelField(title="报表名称", align=2, sort=4)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@ExcelField(title="报表SQL语句", align=2, sort=5)
	public String getSqlText() {
		return sqlText;
	}

	public void setSqlText(String sqlText) {
		this.sqlText = sqlText;
	}
	
	@ExcelField(title="报表列集合元数据(JSON格式)", align=2, sort=6)
	public String getMetaColumns() {
		return metaColumns;
	}

	public void setMetaColumns(String metaColumns) {
		this.metaColumns = metaColumns;
	}
	
	@ExcelField(title="查询条件列属性集合(JSON格式)", align=2, sort=7)
	public String getQueryParams() {
		return queryParams;
	}

	public void setQueryParams(String queryParams) {
		this.queryParams = queryParams;
	}
	
	@ExcelField(title="报表配置选项(JSON格式)", align=2, sort=8)
	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
	}
	
	@Length(min=1, max=11, message="报表状态（1表示锁定，0表示编辑)长度必须介于 1 和 11 之间")
	@ExcelField(title="报表状态（1表示锁定，0表示编辑)", align=2, sort=9)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Length(min=1, max=11, message="报表节点在其父节点中的顺序长度必须介于 1 和 11 之间")
	@ExcelField(title="报表节点在其父节点中的顺序", align=2, sort=10)
	public String getSequence() {
		return sequence;
	}

	public void setSequence(String sequence) {
		this.sequence = sequence;
	}
	
	@Length(min=1, max=500, message="说明备注长度必须介于 1 和 500 之间")
	@ExcelField(title="说明备注", align=2, sort=11)
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	@Length(min=1, max=50, message="创建用户长度必须介于 1 和 50 之间")
	@ExcelField(title="创建用户", align=2, sort=12)
	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	

}